package com.clhbolg.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;


/**
 * 文章视图对象 t_article
 *
 * @author cailinhu
 * @date 2023-02-07
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ExcelIgnoreUnannotated
public class ArticleVo {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @ExcelProperty(value = "")
    private Long id;

    /**
     * 作者
     */
    @ExcelProperty(value = "作者")
    private Long userId;

    /**
     * 文章分类
     */
    @ExcelProperty(value = "文章分类")
    private Long categoryId;

    /**
     * 文章缩略图
     */
    @ExcelProperty(value = "文章缩略图")
    private String articleCover;

    /**
     * 标题
     */
    @ExcelProperty(value = "标题")
    private String articleTitle;

    /**
     * 内容
     */
    @ExcelProperty(value = "内容")
    private String articleContent;

    /**
     * 是否置顶 0否 1是
     */
    @ExcelProperty(value = "是否置顶 0否 1是")
    private Integer isTop;

    /**
     * 是否推荐 0否 1是
     */
    @ExcelProperty(value = "是否推荐 0否 1是")
    private Integer isFeatured;

    /**
     * 是否删除  0否 1是
     */
    @ExcelProperty(value = "是否删除  0否 1是")
    private Integer isDelete;

    /**
     * 状态值 1公开 2私密 3草稿
     */
    @ExcelProperty(value = "状态值 1公开 2私密 3草稿")
    private Integer status;

    /**
     * 文章类型 1原创 2转载 3翻译
     */
    @ExcelProperty(value = "文章类型 1原创 2转载 3翻译")
    private Integer type;

    /**
     * 访问密码
     */
    @ExcelProperty(value = "访问密码")
    private String password;

    /**
     * 原文链接
     */
    @ExcelProperty(value = "原文链接")
    private String originalUrl;

    @NotBlank(message = "分类不能为空", groups = { AddGroup.class, EditGroup.class })
    private String categoryName;
    @NotBlank(message = "标签不能为空", groups = { AddGroup.class, EditGroup.class })
    private List<String> tagNames=new ArrayList<>();
}
